var cc__decorate = __decorate;
Object.defineProperty(exports, "__esModule", {
  value: true
});
var $2ADManager = require("ADManager");
var $2TaSdk = require("TaSdk");
var $2EventsMgr = require("EventsMgr");
var $2DataManager = require("DataManager");
var $2pvzChannel = require("pvzChannel");
var cc__decorator = cc._decorator;
var ccp_ccclass = cc__decorator.ccclass;
var ccp_property = cc__decorator.property;
var def_Fuhuobwz = /* */function (_cc$Component24) {
  babel_inherits(h, _cc$Component24);
  var _super27 = babel_createSuper(h);
  function h() {
    var _this58;
    babel_classCallCheck(this, h);
    _this58 = _super27.apply(this, arguments);
    _this58.j011 = null;
    _this58.j012 = null;
    _this58.close = null;
    _this58.endView = null;
    return _this58;
  }
  babel_createClass(h, [{
    key: "onLoad",
    value: function onLoad() {
      this.j011 = cc.find("j011", this.node);
      this.j012 = cc.find("j012", this.node);
      this.close = cc.find("close", this.node);
      this.j011.on(cc.Node.EventType.TOUCH_START, this.on_fuhuo, this);
      this.j012.on(cc.Node.EventType.TOUCH_START, this.on_bxx, this);
      this.close.on(cc.Node.EventType.TOUCH_START, this.on_bxx, this);
      switch ($2ADManager.default.instance.sdkType) {
        case $2ADManager.SDK_TYPE.WeChat:
          $2ADManager.default.instance.showNative(2);
          $2ADManager.default.instance.showNative(3);
          $2ADManager.default.instance.showNative(1);
          $2ADManager.default.instance.hideNative(0);
          $2ADManager.default.instance.showBanner();
      }
    }
  }, {
    key: "on_bxx",
    value: function on_bxx() {
      this.endView.active = true;
      this.node.active = false;
    }
  }, {
    key: "on_fuhuo",
    value: function on_fuhuo() {
      $2TaSdk.default.instance.AdsButtonClick($2TaSdk.VideoIndex.jjdf);
      var e = this;
      $2pvzChannel.pvzChannel.instance().showVideo({
        sucCall() {
          e.getreward();
        },
        failCall() {},
        endCall() {}
      });
    }
  }, {
    key: "getreward",
    value: function getreward() {
      this.node.active = false;
      $2DataManager.default.instance.fuhuo_flag = true;
      $2EventsMgr.EventsManager.emit("fuhuo");
    }
  }]);
  return h;
}(cc.Component);
cc__decorate([ccp_property(cc.Node)], def_Fuhuobwz.prototype, "endView", undefined);
def_Fuhuobwz = cc__decorate([ccp_ccclass], def_Fuhuobwz);
exports.default = def_Fuhuobwz;